Streaming of Access Logs
IO River provides the ability to get CDN access logs in a unified format. This means logs from all CDNs will be streamed using the same format for easy processing. To set up logs, you first need to configure a log destination. Then you need to define a Behavior to stream logs to this destination.
Creating a Log Destination
To create an access-log destination:
-
Navigate to your service.
-
In the sidebar, select Logs, and then select Log Destinations.
-
Click the Add Destination button.
-
Fill out the new destination form:
- Destination Name - Type a friendly name for the destination.
- Destination Type - Select the type of destination:
- AWS S3 bucket
- S3 Compatible
- Hydrolix
- In case of S3 bucket:
- Pick either Assume Role or Access Key as the credentials type, and fill in your bucket credentials.
- Bucket Name - Type the S3 bucket name.
- Path - Use
/for root path, or specify other path prefix within the bucket. - Region - The region of the bucket.
- In case of Hydrolix:
- Provide authentication details: User, Password, and Authentication Token.
- Provide Endpoint, Project and Table for the logs.
-
Check Anonymize IP if you want to obfuscate the end-user's IP address (removes the first octet of the IP address).
-
Select the Log File Format:
- JSON List – A plain
jsonlist. - JSON Object – A
jsonobject containing arecordsfield. - Delimited Line JSON – Each line is a
json. - CSV – A
csvfile.
- JSON List – A plain
-
Click Save Changes.
Once created, the new destination will show up in the list of logs destinations.
Streaming Logs to Destination
In this step you will set up log streaming to the configured destination by configuring a Behavior. You can either create a new behavior, or add an Action to an existing one.
To stream logs by creating a new behavior:
- Navigate to your service.
- Choose the Behaviors tab.
- Click the Add New Behavior button.
- Fill out the new behavior form:
- Name - Enter the name of the new behavior
- Path Pattern - Wildcard expression which identifies the paths to apply the behavior on.
- Click the Add Action button.
- In the Action Type dropdown, select Stream Logs.
- Log Destination - Select the log destination previously created.
- Sample Rate - Type the percentage of logs which should be sampled and sent to the destination.
Note
Configuring streaming logs on a path pattern with a high traffic volume and a high sample rate can result in a high log volume being sent to your log destination.